//
//  UtilityConfig.h
//  IntelligenceCommunity
//
//  Created by zhangpei on 15/12/2.
//  Copyright © 2015年 zhangpei. All rights reserved.
//

#define USERDEFAULTS [NSUserDefaults standardUserDefaults]

#pragma mark ---- AppDelegate
//AppDelegate
#define APPDELEGATE (AppDelegate*)[[UIApplication sharedApplication]  delegate]

//获取屏幕 宽度、高度
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)


//屏幕
#define WINDOW ((UIWindow *)[[[UIApplication sharedApplication] windows] objectAtIndex:0])


//设置是否编译日志
#ifdef DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#define debugMethod() NSLog(@"%s", __func__)
#else
#define NSLog(...)
#define debugMethod()
#endif


#define COLORRGBA(r,g,b,a)     [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]

//Alert //title,message,alertDelegate,cancelTitle,otherTitle
#define ALERT(titleStr,messageStr,alertDelegate,cancelTitle,otherTitle) [[[UIAlertView alloc] initWithTitle:titleStr message:messageStr  delegate:alertDelegate cancelButtonTitle:cancelTitle otherButtonTitles:otherTitle, nil] show]

#define UmengAppkey     @"566297c467e58eab5100570b"
#define BPushAPIkey     @"bV86bcZ405cUnfRGHj2Qg9RX"
#define EasemobAppkey   @"adtec-fsg#powerisecommunity"


#define TemporaryNotOpened @"暂未开通"

#define IOSVERSION_FLOATVALUE ([[[UIDevice currentDevice] systemVersion] floatValue])


//状态栏、导航栏、标签栏 size
#define STATUSBARFRAME [UIApplication sharedApplication].statusBarFrame
#define NAVIGATIONBARFRAME self.navigationController.navigationBar.frame
#define TABBARFRAME self.tabBarController.tabBar.frame

//语言国际化
//#define NSLocalizedString(key, comment) [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]

//当前语言
/**
 *得到本机现在用的语言
 * en:英文  zh-Hans:简体中文   zh-Hant:繁体中文    ja:日本  ......
 */
#define CurrentLanguage [[NSLocale preferredLanguages] objectAtIndex:0]


#define TABLEVEIW_ROW_HEIGHT 0.0625*SCREEN_HEIGHT
